<template>
  <div v-loading="loading" class="Fxpg_details" element-loading-background="rgba(0, 0, 0, 0.4)">
    <div class="Fxpg_cur listTablesOther">
      <div class="RightCardTitle">城镇、集镇、村庄</div>
      <!-- <el-table
        :data="fxpgList.villagelst"
        style="width: 100%;padding-bottom: 20px;"
        class="tableFXPg"
      >
        <el-table-column align="center" prop="ewName" width="70" label="名称" />
        <el-table-column align="center" prop="townAdnm" label="所属乡镇" width="60" />
        <el-table-column align="center" prop="person" label="负责人" />
        <el-table-column align="center" prop="pCount" label="人口数" width="60" />
        <el-table-column :class-name="'tapadlr0'" align="center" prop="level" label="风险等级" width="65">
          <template slot-scope="scope" >
            <span v-show="scope.row.level == '1'" class="warningYy1">极危险</span>
            <span v-show="scope.row.level == '2'" class="warningYy2">危险</span>
            <span v-show="scope.row.level == '3'" class="warningYy3">警戒</span>
            <span v-show="scope.row.level == '4'" class="warningYy4">关注</span>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="propose" label="风险点建议" min-width="40" />
      </el-table> -->

      <div class="tabel_common tabel_commons">
        <div class="table">
          <div class="thead">
            <div class="tr">
              <div class="th"> 名称 </div>
              <div class="th"> 所属乡镇 </div>
              <div class="th"> 人口数 </div>
              <div class="th"> 风险等级 </div>
              <div class="th"> 风险点建议 </div>
            </div>
          </div>
          <el-scrollbar style="height:22vh; width: 100%;" class="el_scrollbar">
            <div class="tbody">
              <template v-if="fxpgList.villagelst && fxpgList.villagelst.length <=0 ">
                <div slot="no-results" class="noData" style="background-position: center 62%;padding-top: 38%;">暂无数据</div>
              </template>
              <div v-if="fxpgList.villagelst" class="tr" v-for="dict in fxpgList.villagelst" :key="dict.ewName">
                  <!-- :class="['tr', PionId == dict.id ? 'ta' : '']"> -->
                  <div class="td"> {{ dict.ewName }} </div>
                  <div class="td"> {{ dict.townAdnm }} </div>
                  <div class="td"> {{ dict.pCount }} </div>
                  <div class="td">
                    <div class="img" v-show="dict.level == '1'">
                      <img src="@/assets/yuanimg/sodanger.png" alt="" />
                    </div>
                    <div class="img" v-show="dict.level == '2'">
                      <img src="@/assets/yuanimg/danger.png" alt="" />
                    </div>
                    <div class="img" v-show="dict.level == '3'">
                      <img src="@/assets/yuanimg/warning.png" alt="" />
                    </div>
                    <div class="img" v-show="dict.level == '4'">
                      <img src="@/assets/yuanimg/action.png" alt="" />
                    </div>
                  </div>
                  <div class="td"> {{ dict.propose }} </div>
              </div>
            </div>
          </el-scrollbar>
        </div>
      </div>
    </div>
    <div class="Fxpg_cur listTablesOther">
      <div class="RightCardTitle">企事业单位影响情况</div>
      <!-- <el-table
        :data="fxpgList.infrastructurelst"
        class="tableFXPg"
        style="width: 100%;height: calc(100% - 30px);padding-bottom: 20px;"
      >
        <el-table-column align="center" prop="ewName" width="70" label="名称" />
        <el-table-column  align="center" :class-name="'tapadlr0'" width="60" prop="townAdnm"  label="所属行政单元" />
        //<el-table-column align="center" prop="person" label="负责人" /> 
        <el-table-column align="center" prop="pCount" label="影响人数" width="60" />
        <el-table-column align="center" :class-name="'tapadlr0'" prop="level" label="风险等级" width="65">
          <template slot-scope="scope">
            <span v-show="scope.row.level == '1'" class="warningYy1">极危险</span>
            <span v-show="scope.row.level == '2'" class="warningYy2">危险</span>
            <span v-show="scope.row.level == '3'" class="warningYy3">警戒</span>
            <span v-show="scope.row.level == '4'" class="warningYy4">关注</span>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="propose" label="风险点建议" min-width="40" />
      </el-table> -->

      <div class="tabel_common tabel_commons">
        <div class="table">
          <div class="thead">
            <div class="tr">
              <div class="th"> 名称 </div>
              <div class="th"> 所属行政单元 </div>
              <div class="th"> 影响人数 </div>
              <div class="th"> 风险等级 </div>
              <div class="th"> 风险点建议 </div>
            </div>
          </div>
          <el-scrollbar style="height:22vh; width: 100%;" class="el_scrollbar">
            <div class="tbody">
              <template v-if=" fxpgList.infrastructurelst && fxpgList.infrastructurelst.length <=0 ">
                <div slot="no-results" class="noData" style="background-position: center 62%;padding-top: 38%;">暂无数据</div>
              </template>
              <div v-if="fxpgList.infrastructurelst" class="tr" v-for="dict in fxpgList.infrastructurelst" :key="dict.ewName">
                  <!-- :class="['tr', PionId == dict.id ? 'ta' : '']"> -->
                  <div class="td"> {{ dict.ewName }} </div>
                  <div class="td"> {{ dict.townAdnm }} </div>
                  <div class="td"> {{ dict.pCount }} </div>
                  <div class="td">
                    <div class="img" v-show="dict.level == '1'">
                      <img src="@/assets/yuanimg/sodanger.png" alt="" />
                    </div>
                    <div class="img" v-show="dict.level == '2'">
                      <img src="@/assets/yuanimg/danger.png" alt="" />
                    </div>
                    <div class="img" v-show="dict.level == '3'">
                      <img src="@/assets/yuanimg/warning.png" alt="" />
                    </div>
                    <div class="img" v-show="dict.level == '4'">
                      <img src="@/assets/yuanimg/action.png" alt="" />
                    </div>
                  </div>
                  <div class="td"> {{ dict.propose }} </div>
              </div>
            </div>
          </el-scrollbar>
        </div>
      </div>
    </div>
    <!-- <div class="Submerge">
      <div><span>{{ fxpgList.drownArea || 0 }}</span>淹没面积(km²)</div>
      <div><span>{{ fxpgList.sumPoint || 0 }}</span>风险点</div>
      <div><span>{{ fxpgList.sumHouse || 0 }}</span>影响户数(户)</div>
      <div><span>{{ fxpgList.sumPCount || 0 }}</span>影响人口数(人)</div>
    </div> -->
    <!-- 数据概况 -->
    <div class=" riskInfo">
      <div class="riskInfo_item"> 
        <div></div>
        <div class="inner">
          <div class="num">{{ fxpgList.drownArea || 0 }}</div>
          <div>淹没面积(km²)</div>
        </div>
      </div>
      <div class="riskInfo_item">
        <div></div>
        <div class="inner">
          <div class="num">{{ fxpgList.sumPoint || 0 }}</div>
          <div>风险点</div>
        </div>
      </div>
      <div class="riskInfo_item">
        <div></div>
        <div class="inner">
          <div class="num">{{ fxpgList.sumHouse || 0 }}</div>
          <div>影响户数(户)</div>
        </div>
      </div>
      <div class="riskInfo_item">
        <div></div>
        <div class="inner">
          <div class="num">{{ fxpgList.sumPCount || 0 }}</div>
          <div>影响人口数(人)</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { GetRiskDrowningList } from '../../../api/xuna.js'
export default {
    data() {
        return {
            idParams: '',
            fxpgList: {},
            loading: false
        }
    },
    mounted() {

    },
    beforeDestroy() {
    },
    created() {
    },
    methods: {
        getGetRiskDrowningList(id) {
            this.loading = true
            GetRiskDrowningList({ id: id }).then((res) => {
                this.loading = false
                if (res.isSuccess && res.data.length > 0) {
                    this.fxpgList = res.data[0]
                } else {
                    this.fxpgList = []
                }
            }).catch(err=>{
               this.loading = false;
            })
        }
    }
}
</script>
<style lang="less" scoped>

.Fxpg_details {
  display: flex;
  flex-direction: column;
  height: 100%;
  .Fxpg_cur {
    //height: 41%;
    flex-shrink: 0;
    background: rgba(3,34,55,0.39);
    overflow: hidden;
    border-bottom: 1px solid #3F72AA;
    padding-bottom: 8px;
    .tableFXPg{
      height: calc(100% - 40px);
    }
    
  }
}
.Submerge {
  color: #ffffff;
  font-size: 12px;
  text-align: center;
  display: -webkit-flex;
  display: flex;
  margin-top: 10px;
  > div {
    width: 25%;
    span {
		font-weight: bold;
		font-size: 22px;
		display: block;
		width: 100%;
		height: 80px;
		line-height: 60px;
		text-shadow:  0px 0px 9px rgba(188,248,255,0.79);
		background: url("~@/assets/newimg/StatisticsBg.png") no-repeat top center;
		background-size: 90% 100%;
    }
  }
}
.warningYy4, .warningYy3, .warningYy2, .warningYy1{
  height:auto;
}
</style>
<style lang="less">
.tapadlr0 {
   .cell{
        padding:0px!important;
      }
} 
.riskInfo{
  display: flex;
  flex-wrap: wrap;
  padding: 10px 4px 10px;
  .riskInfo_item{
    width: 50%;
    height: 75px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-family: Source Han Sans CN;
    font-weight: 400;
    color: #FFFEFE;
  }
  .inner{
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
    .num{
      font-size: 24px;
      font-family: DIN;
      font-weight: bold;
      color: #00FFFF;
    }
  }
  .riskInfo_item div:nth-child(1){
    width: 50px;
  }
  .riskInfo_item:nth-child(1){
    background: url('~@/assets/newimg/4.png') no-repeat;
    background-size: 90%;
  }
  .riskInfo_item:nth-child(2){
    background: url('~@/assets/newimg/5.png') no-repeat;
    background-size: 90%;
  }
  .riskInfo_item:nth-child(3){
    background: url('~@/assets/newimg/6.png') no-repeat;
    background-size: 90%;
  }
  .riskInfo_item:nth-child(4){
    background: url('~@/assets/newimg/7.png') no-repeat;
    background-size: 90%;
  }
}
</style>
